package com.solo.eggsolo.exception;

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.solo.eggsolo.common.bean.JsonResult;
/**
 * 
 * @author Yu
 *
 */
@RestControllerAdvice
public class DefaultExceptionHandlerAdvice {
private Logger logger = LoggerFactory.getLogger(DefaultExceptionHandlerAdvice.class);
	
	@ExceptionHandler(value = { Exception.class })
	public JsonResult exception(Exception exception) {
		logger.info(exception.getMessage(), exception);
		
		return new JsonResult(500, Boolean.FALSE, exception.getMessage());
	}

}
